$(function(){
	page.bind();
	page.xx();
	
});

var page={
    dateil:"",
    bind:function(){
    	 $("#printBtn").bind("click",function(){
    		 window.print();
    	 });
    },
    xx:function(){
    	var orderId=$("#orderId").val();
    	$("#code").qrcode({
    		render: "canvas", //table方式
    		width: 100, //宽度
    		height:100, //高度
    		text:"http://www.shinehao.net/weixin/weiXin/sh?orderId="+orderId //任意内容
    	});
    	 var img = document.getElementById("image"); /// get image element
    	 var canvas  = document.getElementsByTagName("canvas")[0];  /// get canvas element
    	 img.src = canvas.toDataURL();                   
    },
    getHead:function(){
    	var orderId=$("#orderId").val();
    	ajaxUtil.ajaxRuquest("orderProcedureTemplate/getOrderMain",{"orderId":orderId},function(data){
	          console.log(data);
    		  var html="<tr>";
	          html+="<td> 订单号："+data.customerOrderId+"</td>" +
	          		"<td></td>" +
	          		"<td>厂号</td>" +
	          		"<td colspan='2'>"+data.factoryId+"</td>" +
	          		"<td></td>" +
	          		"<td>交期："+data.jiaoDate+"</td>" +
	          		"<td>订单数</td>" +
	          		"<td>"+data.orderCount+"</td>"+
	          		"<td></td>" +
	          		"<td>投料数</td>"+
	          		"<td>"+data.feedCount+"</td>"+
	          		"<td></td>"+
	          		"<td>客号</td>"+
	          		" <td colspan='2'>"+data.customerId+"</td>"+
	          		"<td>尺寸：</td>"+
	          		"<td contentEditable='true'></td>"+
	          		"<td></td>" +
	          		"<td></td>" +
	          		"<td></td>" +
	          		"<td></td>" +
	          		"<td></td>";
	          page.dateil=data.detail;
	          $("#tableBody").append(html);
    	});
    }

}


